package com.xzgj.fmmall.vo;

import com.xzgj.fmmall.entity.OrderItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "OrdersVO对象",description = "订单信息")
public class OrdersVO {
    @ApiModelProperty(dataType = "order_id",value = "订单id，同时也是订单编号",required = false)
    @Id
    private String order_id;
    @ApiModelProperty(dataType = "user_id",required = true,value = "用户id")
    private String user_id;
    @ApiModelProperty(dataType = "untitled",required = true,value = "产品名称，多个产品用，隔开")
    private String untitled;
    @ApiModelProperty(dataType = "receiver_name",required = true,value = "收货人姓名")
    private String receiver_name;
    @ApiModelProperty(dataType = "receiver_mobile",required = true,value = "收货人手机")
    private String receiver_mobile;
    @ApiModelProperty(dataType = "receiver_address",required = true,value = "收货人地址")
    private String receiver_address;
    @ApiModelProperty(dataType = "price",required = true,value = "商品价格")
    private double price;
    @ApiModelProperty(dataType = "actualAmount",required = true,value = "实付金额")
    private double actualAmount;
    @ApiModelProperty(dataType = "payType",required = true,value = "支付方式")
    private int payType;
    @ApiModelProperty(dataType = "close_type",required = true,value = "订单关闭：1.超时未支付；2.退款关闭；3.卖家取消")
    private int close_type;
    @ApiModelProperty(dataType = "orderRemark",required = true,value = "订单备注")
    private String orderRemark;
    @ApiModelProperty(dataType = "status",required = true,value = "订单状态")
    private String status;
    @ApiModelProperty(dataType = "delivery_type",required = true,value = "配送方式")
    private int delivery_type;
    @ApiModelProperty(dataType = "delivery_flow_id",required = true,value = "物流单号")
    private String delivery_flow_id;
    @ApiModelProperty(dataType = "order_freight",required = true,value = "订单运费")
    private double order_freight;
    @ApiModelProperty(dataType = "delete_status",required = true,value = "逻辑删除状态：1.删除；0.未删除")
    private String delete_status;
    @ApiModelProperty(dataType = "cancel_time",required = true,value = "订单取消时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date cancel_time;
    @ApiModelProperty(dataType = "finish_time",required = true,value = "订单完成时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date finish_time;
    @ApiModelProperty(dataType = "create_time",required = true,value = "订单创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date create_time;
    @ApiModelProperty(dataType = "update_time",required = true,value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date update_time;

    /**
     * 根据用户的id分页查询当前用户的订单信息，关联查询订单中的商品快照；
     * 根据用户的id和订单状态分页查询当前用户的订单信息，关联查询订单中的商品快照；
     * 因为原有的实体类Orders中没有商品快照的属性，故新增订单快照集合
     */
    public List<OrderItem> orderItems;
}
